Micron Document
Fox's Git Mirrors

Node / RFnexus / code.git / files / simd_sort.hh

Displaying Raw • Download

simd_sort.hh master (5e719f46) Text, 495 B

/*
Sorting for SIMD types

Copyright 2024 Ahmet Inan <inan@aicodix.de>
*/

#pragma once

#include "sort.hh"

template <typename TYPE, int WIDTH>
static inline SIMD<typename SIMD<TYPE, WIDTH>::uint_type, WIDTH> vorder(SIMD<TYPE, WIDTH> a)
{
SIMD<typename SIMD<TYPE, WIDTH>::uint_type, WIDTH> p;
CODE::insertion_sort(p.v, a.v, WIDTH);
return p;
}

template <typename TYPE, int WIDTH>
static inline SIMD<TYPE, WIDTH> vsort(SIMD<TYPE, WIDTH> a)
{
CODE::insertion_sort(a.v, WIDTH);
return a;
}


Served by rngit 1.4.1 - Generated in 0.02s